package com.applearning.appsware.triky;

import android.content.Intent;
import android.media.MediaPlayer;
import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.ImageView;

import java.util.Timer;
import java.util.TimerTask;


//<editor-fold desc="información general" >
/*      *AppsWare Colombia, 2015
        *Bogotá,Colombia,America del sur.
        *Licencia GNU GPL v3
        *
        */
//</editor-fold>



public class ActividadPresentacion extends ActionBarActivity {



    //<editor-fold desc="Informacion sobre version y autor/es">
    /**
     * @version 1.0 (1. 26/01/2015)
     * @author Javier Mayorga
     * @author Freddy Aparicio
     */
    //</editor-fold>


    private MediaPlayer mp;
    private long splashTime = 5000;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.layout_presentacion);
        android.support.v7.app.ActionBar actionBar= getSupportActionBar();
        actionBar.hide();

        ImageView logo =(ImageView)findViewById(R.id.ivLogoAwc);
        logo.setImageResource(R.drawable.logo_awc);
        Animation anim = AnimationUtils.loadAnimation(this,R.anim.anim_presentacion_awc);
        anim.setFillAfter(true);
        logo.startAnimation(anim);
        mp = MediaPlayer.create(ActividadPresentacion.this,R.raw.sonido);
        mp.start();
        TimerTask task = new TimerTask() {
            @Override
            public void run() {
                Intent intent = new Intent().setClass(ActividadPresentacion.this,ActividadPresentacionTriky.class);
                startActivity(intent);
                overridePendingTransition(R.anim.anim_zoomforward_in,R.anim.anim_zoomforward_out);
                finish();
            }
        };
        Timer timer = new Timer();
        timer.schedule(task,splashTime);

    }


}
